package com.cecsmsserve.common;

public class CommonResult {
    private Integer code;
    private String msg;
    private Object data;

    public static CommonResult success() {
        return new CommonResult(200, "操作成功", null);
    }

    public static CommonResult success(Object data) {
        return new CommonResult(200, "操作成功", data);
    }

    public static CommonResult success(String message, Object data) {
        return new CommonResult(200, message, data);
    }

    public static CommonResult error(int code, String message) {
        return new CommonResult(code, message, null);
    }

    public static CommonResult error(String message) {
        return new CommonResult(500, message, null);
    }

    public CommonResult() {
    }

    public CommonResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
} 